<template>
  <view>
    <view v-if="menuold.length > 0" class="lims_menu">
      <view v-for="(item, index1) in menuold" :key="index1">
        <label>{{ item.title }}</label>
        <view class="limsMenuList">
          <view
            v-for="child in item.list"
            :key="child.activityName"
            @click="handleClick(child.url)"
          >
            <view class="limsMenuList_text">
              <label>{{ child.activityName }}</label>
            </view>
          </view>
        </view>
      </view>
      <view class="commonLim-block"></view>
    </view>
  </view>
</template>

<script setup>
const menuold = ref([
  {
    //废弃，暂做历史
    title: "领料管理",
    list: [
      {
        activityName: "新增领料",
        url: "/pages/NewRegistration/NewRegistration?title=新增领料",
      },
      {
        activityName: "领料查询",
        url: "/pages/MaterialRequisition/MaterialRequisition?activityName=领料查询",
      },
      {
        activityName: "新增退库",
        url: "/pages/ReturnWarehouse/ReturnWarehouse?title=新增退库",
      },
      {
        activityName: "退库查询",
        url: "/pages/ReturnList/ReturnList?activityName=退库查询",
      },
    ],
  },
  {
    title: "分轮管理",
    list: [
      {
        activityName: "预分轮",
        url: "/pages/yufenlun/yufenlun",
      },
      {
        activityName: "新增分轮",
        url: "/pages/addoreditround/addoreditround?title=新增分轮",
      },
      {
        activityName: "分轮拆分",
        url: "/pages/RoundSplitting/RoundSplitting",
      },
      {
        activityName: "分轮查询",
        url: "/pages/MyFenlun/MyFenlun?title=分轮查询",
      },
      {
        activityName: "我的分轮",
        url: "/pages/MyFenlun/MyFenlun?title=我的分轮",
      },
    ],
  },
  {
    title: "工序管理",
    list: [
      {
        activityName: "新增工序",
        url: "/pages/AdditionalProcess/AdditionalProcess?title=新增工序",
      },
      {
        activityName: "我的工序",
        url: "/pages/MyProcess/MyProcess",
      },
    ],
  },
  {
    title: "分卷管理",
    list: [
      {
        activityName: "预分卷",
        url: "/pages/DivisionOfVolumes/DivisionOfVolumes",
      },
      {
        activityName: "剪线分卷",
        url: "/pages/ThreadAndDivide/ThreadAndDivide",
      },
      {
        activityName: "我的分卷",
        url: "/pages/MySubVolume/MySubVolume",
      },
    ],
  },
  {
    title: "待检管理",
    list: [
      {
        activityName: "待检确认",
        url: "/pages/PendingInspectionConfirmation/PendingInspectionConfirmation?title=待检确认",
      },
      {
        activityName: "称重",
        url: "/pages/PendingInspectionConfirmation/PendingInspectionConfirmation?title=称重",
      },
      {
        activityName: "已检查询",
        url: "/pages/PendingInspectionConfirmation/PendingInspectionConfirmation?title=已检查询",
      },
    ],
  },
  {
    title: "库存管理",
    list: [
      {
        activityName: "生产待入库",
        url: "/pages/PendingStorage/PendingStorage?title=生产待入库",
      },
      {
        activityName: "已入库查询",
        url: "/pages/PendingStorage/PendingStorage?title=已入库查询",
      },
    ],
  },
]);
const handleClick = (url) => {
  uni.navigateTo({
    url: url,
  });
};
</script>

<style lang="scss" scoped>
.lims_index > image {
  width: 100%;
  height: 322rpx;
}

.lims_menu {
  padding: 24rpx;
}

.lims_menu > view {
  margin: 0 0rpx 24rpx;
  background: #ffffff;
  box-shadow: 0px 3px 20px 0px rgba(162, 162, 162, 0.35);
  border-radius: 4rpx;
}

.lims_menu > view > label {
  width: 100%;
  height: 84rpx;
  line-height: 84rpx;
  padding: 0 24rpx;
  font-size: 32rpx;
  font-weight: bold;
}

.limsMenuList {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0 24rpx 24rpx;
  grid-gap: 24rpx;
}

.limsMenuList > view {
  display: flex;
  width: 100%;
  height: 160rpx;
  justify-content: center;
  align-items: center;
  background-color: #0085ff;
  box-sizing: border-box;
  background-image: linear-gradient(to top, #0085ff, #69b4ff);
}

.limsMenuList_num {
  width: 80rpx;
  height: 100%;
  flex-shrink: 0;
  font-size: 32rpx;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  word-break: break-word;
  background: #4a90e2;
}

.limsMenuList_text {
  flex: 1;
  padding: 0 18rpx;
  display: flex;
  flex-direction: column;
}

.limsMenuList_text > label {
  line-height: 1.3;
  font-size: 24rpx;
  color: #fff;
  text-align: center;
}

.limsMenuList_text > text {
  padding-top: 8rpx;
  font-size: 24rpx;
  color: #666;
}
</style>
